package com.hsnn.medstgmini.pro.project.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.hsnn.medstgmini.base.std.model.StdCompinfo;

/**
 * @category 采购项目配送企业
 * @author 张俊
 * @date   2015-06-11
 */
@Entity
@Table(name = "bid_projcompany")
public class BidProjCompany implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 9081428945303846497L;
	private String projDelId;//配送企业明细id
	private String projId;//采购项目id
	private String compId;//配送企业Id(基础)
	private Integer status;//状态0禁用1启用
	private Date updDatetime;//更新时间
	private String updUser;//更新人
	
	private String compCode;
	
	private BidProject bidProject;//采购项目实体类对象
	
	private StdCompinfo stdCompinfo;//企业库实体类对象
	
	
	public long count;//记录总数
	
	// Constructors
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="proj_id")
	public BidProject getBidProject() {
		return bidProject;
	}

	public void setBidProject(BidProject bidProject) {
		this.bidProject = bidProject;
	}
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="comp_id")
	public StdCompinfo getStdCompinfo() {
		return stdCompinfo;
	}

	public void setStdCompinfo(StdCompinfo stdCompinfo) {
		this.stdCompinfo = stdCompinfo;
	}

	
	
	/** default constructor */
	public BidProjCompany() {
	}

	/** full constructor */
	public BidProjCompany(String projId, String compId, Integer status,
			Date updDatetime, String updUser) {
		this.projId = projId;
		this.compId = compId;
		this.status = status;
		this.updDatetime = updDatetime;
		this.updUser = updUser;
	}

	// Property accessors
	@Id
	@Column(name = "proj_del_id", unique = true, nullable = false, length = 36)
	public String getProjDelId() {
		return this.projDelId;
	}

	public void setProjDelId(String projDelId) {
		this.projDelId = projDelId;
	}

	@Column(name = "proj_id",insertable=false,updatable=false, length = 36)
	public String getProjId() {
		return this.projId;
	}

	public void setProjId(String projId) {
		this.projId = projId;
	}

	@Column(name = "comp_id", insertable=false,updatable=false, length = 36)
	public String getCompId() {
		return this.compId;
	}

	public void setCompId(String compId) {
		this.compId = compId;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "upd_datetime", length = 19)
	public Date getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user", length = 36)
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}

	@Override
	public String toString() {
		return "BidProjCompany [projDelId=" + projDelId + ", projId=" + projId
				+ ", compId=" + compId + ", status=" + status
				+ ", updDatetime=" + updDatetime + ", updUser=" + updUser
				+ ", bidProject=" + bidProject + ", stdCompinfo=" + stdCompinfo
				+ "]";
	}

	@Transient
	public long getCount() {
		return count;
	}

	public void setCount(long count) {
		this.count = count;
	}
	
	@Transient
	public String getCompCode() {
		return compCode;
	}

	public void setCompCode(String compCode) {
		this.compCode = compCode;
	}

	
}